/*
 * SerializableC.cpp
 *
 *  Created on: 14.11.2011
 *      Author: Pavel Sinay
 */

#include <strstream>
#include <iostream>

#include "SerializableC.h"

const std::string SerializableC::m_name = "C";

SerializableC::SerializableC() {
}

SerializableC::~SerializableC() {
}

std::string SerializableC::serialize() const {
	std::strstream stream;
	stream << m_name << "\n" << m_c;
	return stream.str();
}


void SerializableC::execute(const std::string &data) {
	std::strstream stream;
	std::string name;

	stream << data;
	stream >> name;
	if (name == m_name) {
		stream >> m_c;
		std::cout << "SerializableC self execution, c = " << m_c << std::endl;
	}
}

int SerializableC::getC() const
{
    return m_c;
}

void SerializableC::setC(int m_c)
{
    this->m_c = m_c;
}


